<template>
    <div class="out">
        <div class="swiper-container">
            <div class="swiper-wrapper">
                <div class="swiper-slide" v-for="(i,index) in swiperList" :key="index">
                        <div class="ctx">
                            <img :src="require('@/assets'+i.pic)"/>
                            <div>{{i.title}}</div>
                            <div>{{i.subtitle}}</div>
                        </div>
                </div>
            </div>
            <!-- 分页器 -->
            <div class="swiper-pagination"></div>
        </div>
        <div class="btn" @click="$router.push('/login')">跳过</div>
    </div>
</template>
<script>
import Swiper from 'swiper'
import 'swiper/css/swiper.min.css'

export default {
    data(){
        return{
            swiperList:[
                {
                    pic:'/swiper/01.jpeg',
                    title:'做最好的咖啡',
                    subtitle:'2017年50佳'
                },
                {
                    pic:'/swiper/02.jpeg',
                    title:'做最纯的咖啡',
                    subtitle:'2018年20佳'
                },
                 {
                    pic:'/swiper/03.jpeg',
                    title:'做最受欢迎的咖啡',
                    subtitle:'2019年10佳'
                }
            ]
        }
    },
    mounted(){
        new Swiper('.swiper-container', {

            autoplay: {
                delay: 2000
            },

            effect : 'fade',

            pagination: {
                el: '.swiper-pagination'
            }
        })
    }
}
</script>
<style scoped>
.swiper-container{
    width: 100%;
    height: 100%;
}
.swiper-slide{
    background: #091E2E;
}
.ctx{
    width: 100%;
    margin: 150px 0 0;
    color: #fff;
    text-align: center;
}
.ctx div{
    margin: 20px;
}
.ctx img{
    width: 200px;
    height: 200px;
    margin: auto;
    display: block;
    border-radius: 50%;
}
.swiper-pagination{
    bottom: 200px;
}
.btn{
    position: fixed;
    z-index: 20;
    bottom: 130px;
    left: 0;
    right: 0;
    width: 200px;
    margin: auto;
    height: 50px;
    line-height: 50px;
    text-align: center;
    background: #9BA3B5;
    border-radius: 25px;
    font-size: 18px;
    color: #fff;
}

</style>